function crearAjax(){
	 var objetoAjax=false;
	 try {
	  /*Para navegadores distintos a internet explorer*/
	  objetoAjax = new ActiveXObject("Msxml2.XMLHTTP");
	 } catch (e) {
	  try {
			   /*Para explorer*/
			   objetoAjax = new ActiveXObject("Microsoft.XMLHTTP");
			   }
			   catch (E) {
			   objetoAjax = false;
	  }
	 }
	 if (!objetoAjax && typeof XMLHttpRequest!='undefined') {
	  objetoAjax = new XMLHttpRequest();
	 }
	 return objetoAjax;
}

function obtenerDatosAjax(url){
	//alert('Entro'+url);
	var ajax=crearAjax();
	ajax.open ('GET', url, true);
	//ajax.onreadystatechange = function() {
         //if (ajax.readyState==1) {
			// document.getElementById("boxi").innerHTML="Cargando.......";
         //}
         //else if (ajax.readyState==4){
			// if(ajax.status==200){
				// document.getElementById("boxi").innerHTML=ajax.responseText;
            // }
            // else if(ajax.status==404){
			//	 document.getElementById("boxi").innerHTML = "La direccion: "+ url +" no existe";
			//	 }
			//	 else{
			//		 document.getElementById("boxi").innerHTML = "Error: ".ajax.status;
			//		 }
        //  }
    // }
	 ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	 ajax.send(null);
	 return
}
